//
//  HeartRateDataCell.swift
//  DaRings
//
//  Created by HFY on 2022/11/21.
//

import UIKit
import MYModule

class HeartRateDataCell: TableViewCell {

    let titleLabel = Label()
    
    let descriptionView = ExPlainView()

    
    override func makeUI() {
        super.makeUI()
        
        contentView.backgroundColor =  UIColor.darkBackground
        
        let bgView = View()
        bgView.cornerRadius = 18.0
        bgView.backgroundColor = UIColor.background
        
        
        descriptionView.updateData(textColor: UIColor.HeartRate.theme, title: "heart_rate_zone_description_title".language, explain: "heart_rate_zone_description_content".language,
                                   explainTextColor: UIColor.HeartRate.theme.withAlphaComponent(0.8),
                                   bgColor: UIColor.HeartRate.theme)
        
        titleLabel.font = Fonts.boldSystemFont(ofSize: 14.0)
        titleLabel.textColor = UIColor.assist_222222
        titleLabel.text = "heart_rate_about_heart_rate_data".language
        
        contentView.addSubview(bgView)
        
        bgView.addSubview(titleLabel)
        bgView.addSubview(descriptionView)
        
        bgView.snp.makeConstraints { make in
            make.top.equalToSuperview()
            make.left.right.equalToSuperview()
            make.bottom.equalToSuperview().offset(-20)
        }
        
        titleLabel.snp.makeConstraints { make in
            make.left.equalToSuperview().offset(20)
            make.top.equalToSuperview().offset(15)
        }
        
        descriptionView.snp.makeConstraints { make in
            make.left.equalToSuperview().offset(15)
            make.right.equalToSuperview().offset(-15)
            make.top.equalTo(titleLabel.snp.bottom).offset(24)
            make.bottom.equalToSuperview().offset(-20)
        }
        
        
    }
    

}
